import re

class StudentFilter(object):
#    filter

 #   def __init__(self, filter):
  #      self.filter = filter

    def applyFilter(self, filter, setOfStudents):
        match = True
        filteredStudentList = []
        for student in setOfStudents:
            for key in filter.keys():
                regularExpression = re.compile(filter[key])
                s=regularExpression.match(unicode(student))
                if s is None:
                    match = False
            if match:
                filteredStudentList.append(student)
            match = True
        return filteredStudentList